forked from Ed-Fi-Alliance-OSS/Ed-Fi-ODS
-
Notifications
You must be signed in to change notification settings - Fork 0
117 lines (112 loc) · 5.84 KB
/
Packages - EdFi.Ods.CodeGen.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
name: Packages - EdFi.Ods.CodeGen
on:
pull_request:
branches: [main]
push:
branches:
- main
workflow_dispatch:
env:
INFORMATIONAL_VERSION: "6.1"
BUILD_INCREMENTER: "210"
CONFIGURATION: "Release"
AZURE_ARTIFACT_URL: "https://pkgs.dev.azure.com/ed-fi-alliance/Ed-Fi-Alliance-OSS/_packaging/EdFi/nuget/v3/index.json"
AZURE_ARTIFACT_NUGET_KEY: ${{ secrets.AZURE_ARTIFACTS_PERSONAL_ACCESS_TOKEN }}
VSS_NUGET_EXTERNAL_FEED_ENDPOINTS : '{"endpointCredentials": [{"endpoint": "https://pkgs.dev.azure.com/ed-fi-alliance/Ed-Fi-Alliance-OSS/_packaging/EdFi/nuget/v3/index.json","password": "${{ secrets.AZURE_ARTIFACTS_PERSONAL_ACCESS_TOKEN }}"}]}'
CURRENT_BRANCH: ${{ GITHUB.REF_NAME }}
jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579 # v2
- name: Setup .NET
uses: actions/setup-dotnet@c0d4ad69d8bd405d234f1c9166d383b7a4f69ed8 # 2.1.0
with:
dotnet-version: 6.0.x
- name: Support longpaths
run: git config --system core.longpaths true
- name: Checkout Ed-Fi-ODS
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579 # v2
with:
repository: Ed-Fi-Alliance-OSS/Ed-Fi-ODS
path: Ed-Fi-ODS/
- name: Is pull request branch exists in Ed-Fi-ODS
working-directory: ./Ed-Fi-ODS/
shell: pwsh
run: |
$patternName = 'refs/heads/' + '${{ env.CURRENT_BRANCH }}'
$is_pull_request_branch = 'False'
$is_pull_request_branch = git ls-remote --heads origin ${{ env.CURRENT_BRANCH }} | Select-String -Pattern $patternName -SimpleMatch -Quiet
if ($is_pull_request_branch -eq $true) {
git fetch origin ${{ env.CURRENT_BRANCH }}
git checkout ${{ env.CURRENT_BRANCH }}
}
- name: Checkout Ed-Fi-ODS-Implementation
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579 # v2
with:
repository: Ed-Fi-Alliance-OSS/Ed-Fi-ODS-Implementation
path: Ed-Fi-ODS-Implementation/
- name: Is pull request branch exists in Ed-Fi-ODS-Implementation
working-directory: ./Ed-Fi-ODS-Implementation/
shell: pwsh
run: |
$patternName = 'refs/heads/' + '${{ env.CURRENT_BRANCH }}'
$is_pull_request_branch = 'False'
$is_pull_request_branch = git ls-remote --heads origin ${{ env.CURRENT_BRANCH }} | Select-String -Pattern $patternName -SimpleMatch -Quiet
if ($is_pull_request_branch -eq $true) {
git fetch origin ${{ env.CURRENT_BRANCH }}
git checkout ${{ env.CURRENT_BRANCH }}
}
- name: Checkout Ed-Fi-Extensions
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579 # v2
with:
repository: Ed-Fi-Alliance-OSS/Ed-Fi-Extensions
path: Ed-Fi-Extensions/
- name: Is pull request branch exists in Ed-Fi-Extensions
working-directory: ./Ed-Fi-Extensions/
shell: pwsh
run: |
$patternName = 'refs/heads/' + '${{ env.CURRENT_BRANCH }}'
$is_pull_request_branch = 'False'
$is_pull_request_branch = git ls-remote --heads origin ${{ env.CURRENT_BRANCH }} | Select-String -Pattern $patternName -SimpleMatch -Quiet
if ($is_pull_request_branch -eq $true) {
git fetch origin ${{ env.CURRENT_BRANCH }}
git checkout ${{ env.CURRENT_BRANCH }}
}
- name: build
working-directory: ./Ed-Fi-ODS/
run: |
.\build.githubactions.ps1 build -Configuration ${{ env.CONFIGURATION }} -InformationalVersion ${{ env.INFORMATIONAL_VERSION}} -BuildCounter ${{ github.run_number }} -BuildIncrementer ${{env.BUILD_INCREMENTER}} -Solution "$env:GITHUB_WORKSPACE/Ed-Fi-ODS/Utilities/CodeGeneration/EdFi.Ods.CodeGen.sln"
shell: pwsh
- name: Run Unit tests for codegen Project
working-directory: ./Ed-Fi-ODS/
run: |
$ErrorActionPreference = 'Stop'
$solution = "$env:GITHUB_WORKSPACE\Ed-Fi-ODS\Utilities\CodeGeneration\EdFi.Ods.CodeGen.sln"
$reports = "$env:GITHUB_WORKSPACE\Ed-Fi-ODS-Implementation\reports\"
if (Test-Path $reports) {
Remove-Item -Path $reports -Force -Recurse | Out-Null
}
New-Item -ItemType Directory -Force -Path $reports | Out-Null
$reportName = $reports + "EdFi.Ods.CodeGen.sln.xml"
& dotnet test $solution --configuration ${{ env.CONFIGURATION }} --filter TestCategory!=LocalOnly --logger "trx;LogFileName=$reportName"
shell: pwsh
- name: pack codegen
working-directory: ./Ed-Fi-ODS/
run: |
.\build.githubactions.ps1 pack -InformationalVersion ${{ env.INFORMATIONAL_VERSION }} -BuildCounter ${{ github.run_number }} -BuildIncrementer ${{env.BUILD_INCREMENTER}} -ProjectFile "$env:GITHUB_WORKSPACE/Ed-Fi-ODS/Utilities/CodeGeneration/EdFi.Ods.CodeGen/EdFi.Ods.CodeGen.csproj" -PackageName "EdFi.Suite3.Ods.CodeGen"
shell: pwsh
- name: Install-credential-handler
run: iex "& { $(irm https://aka.ms/install-artifacts-credprovider.ps1) } -AddNetfx"
shell: pwsh
- name: publish codegen
working-directory: ./Ed-Fi-ODS/
run: |
.\build.githubactions.ps1 publish -InformationalVersion ${{ env.INFORMATIONAL_VERSION }} -BuildCounter ${{ github.run_number }} -BuildIncrementer ${{env.BUILD_INCREMENTER}} -NuGetApiKey ${{ env.AZURE_ARTIFACT_NUGET_KEY }} -EdFiNuGetFeed ${{env.AZURE_ARTIFACT_URL}} -ProjectFile "$env:GITHUB_WORKSPACE/Ed-Fi-ODS/Utilities/CodeGeneration/EdFi.Ods.CodeGen/EdFi.Ods.CodeGen.csproj" -PackageName "EdFi.Suite3.Ods.CodeGen"
shell: pwsh
- name: Upload EdFi.Ods.CodeGen NugetPackage
if: success()
uses: actions/upload-artifact@3cea5372237819ed00197afe530f5a7ea3e805c8 # v3.1.0
with:
name: NugetPackage.Artifacts
path: ${{ github.workspace }}/Ed-Fi-ODS/NugetPackages/*.nupkg